FROM php:7.4.22-fpm-buster

MAINTAINER guosheng1987 <guosheng1987@126.com>

RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list 

RUN apt-get update &&\
    apt-get install -y  git libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxml2-dev libzip-dev &&\
    docker-php-ext-configure gd --with-freetype --with-jpeg &&\
    docker-php-ext-install -j$(nproc) gd

RUN docker-php-ext-install -j$(nproc) bcmath calendar exif gettext sockets dba mysqli pcntl pdo_mysql shmop soap sysvmsg sysvsem sysvshm zip

#pecl 安装扩展 redis
RUN pecl install redis-5.3.2 \
    && docker-php-ext-enable redis
	
# 修改 composer 为国内镜像
RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

#curl -s https://getcomposer.org/installer | php --install-dir=/usr/local/bin/ --filename=composer \ 
#&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

